home *** CD-ROM | disk | FTP | other *** search
- %%BeginProcSet:Canvas_header
- /CanvasDict 250 dict def
- CanvasDict begin
- systemdict/setpacking known{/origpack currentpacking def true setpacking}if
- /bdf{bind def}bind def
- /xdf{exch bind def}bdf
- /min{2 copy gt{exch}if pop}bdf
- /edf{exch def}bdf
- /max{2 copy lt{exch}if pop}bdf
- /cvmtx matrix def
- /currot 0 def
- /rotmtx matrix def
- /origmtx matrix def
- /cvangle{360 exch sub 90 add 360 mod}bdf
- /setrot{/currot edf rotmtx currentmatrix pop 2 copy translate currot rotate neg exch neg exch translate}bdf
- /endrot{rotmtx setmatrix}bdf
- /patspot{1 add 4 mul cvi exch 1 add 4 mul cvi exch patstr exch get exch 7 exch sub 1 exch bitshift and 0 ne{1}{0}ifelse}bdf
- /f/fill load def
- /s{1 setlinewidth penh penv scale stroke}bdf
- /i systemdict /image get def/T true def/F false def/dbg F def
- /ncolors 0 def/st0 ()def/st1 ()def/proc0 {}def
- /penh 0 def/penv 0 def/penv2 0 def/penh2 0 def/samplesize 0 def/width 0 def/height 0 def
- /SpaceExtra 0 def/LetterSpace 0 def/StringLength 0 def/NumSpaces 0 def/JustOffset 0 def
- /icomp % images a color composite. approximates for b&w printer
- {
- /ncolors edf
- ncolors 1 gt
- { %multiple color depth
- /proc0 edf
- dup dup 0 get ncolors div cvi
- exch 0 3 -1 roll put
- 4 -1 roll ncolors div cvi 4 1 roll
- ncolors 3 eq
- {% rgb values
- {
- proc0 dup/st0 edf
- 0 exch %start
- 3 exch %increment
- length %size of string
- dup 3 sub exch 3 div cvi string/st1 edf %destination string
- {
- dup %remember start index
- 0 exch % accumulator at bottom
- dup % duplicate index
- 1 exch %increment
- 2 add %end at index+ 2
- {st0 exch get add}for %only support 8 bits per sample
- 3 div cvi % average rgb get 1 value
- dup 255 gt{pop 255}if
- exch 3 div cvi exch %knock down index to dest value
- st1 3 1 roll put
- }for
- st1 %leave string on stack
- } %image proc definition
- }
- {% cmyk values
- {
- proc0 dup/st0 edf
- 0 exch %start
- 4 exch %increment
- length %size of string
- dup 4 sub exch 4 div cvi string/st1 edf %destination string
- {
- dup %remember start index
- 0 exch % accumulator at bottom
- dup % duplicate index
- 1 exch %increment
- 2 add %end at index+ 2
- {st0 exch get add}for %only support 8 bits per sample
- 3 div % average rgb get 1 value
- exch dup 3 1 roll 3 add st0 exch get add cvi %retrieve black value
- dup 255 gt{pop 255}if
- exch 4 div cvi exch %knock down index to dest value
- st1 3 1 roll put
- }for
- st1 %leave string on stack
- } %iproc definition
- }ifelse
- }if % more that 1 color
- i
- }bdf
- /ci %general routine for generating a color image
- {
- /colorimage where
- {pop false exch colorimage} %use existing colorimage
- {icomp} %approximate with image command
- ifelse
- }bdf
- %%
- %% This routine redefines /s and /f (stroke and fill) to perform image patterns
- %%
- /spat
- {
- /patstr edf
- /ncolors edf
- /s{ matrix currentmatrix
- 1 setlinewidth penh penv scale
- 25 setflat %for curves this reduced number of points
- strokepath
- setmatrix
- impat
- }def
- /f{impat}def
- }bdf
- /impat %% impat to be used in place of stroking or filling
- {
- /samplesize 8 ncolors mul def % number of bytes per row of pattern
- /cnt 0 def % current row count
- currot neg rotate
- clip
- flattenpath
- pathbbox
- 3 -1 roll
- dup /starty edf
- sub abs 8 div ceiling 8 mul cvi /height edf
- exch dup /startx edf
- sub abs samplesize div ceiling samplesize mul cvi /width edf
- startx starty translate
- width height scale
- /st0 width ncolors mul string def
- width height 8 [width 0 0 height neg 0 height]
- {
- patstr %string
- cnt 8 mod samplesize mul %index
- samplesize %count
- getinterval
- /st1 edf
- 0
- samplesize
- st0 length samplesize sub dup 0 le{pop 1}if
- {st0 exch
- st1
- putinterval
- } for
- /cnt cnt 1 add def
- st0
- }bind
- ncolors
- dup 1 eq {icomp}{ci}ifelse
- newpath % we'll act just like stroke/fill and elimate the current path
- }bdf
- %% images an 8 bits/sample color image where color data
- %% is interlaced ie xxxxxx or RRGGBB or CCMMYYKK
- %%
- %% width height sx sy tx ty ncolors cm
- /cm{
- /ncolors edf
- translate
- scale
- /height edf
- /width edf
- /tbitstr width string def
- width height 8 [width 0 0 height neg 0 height]
- {currentfile tbitstr readhexstring pop}bind
- ncolors
- dup 3 eq {ci}{icomp}ifelse
- }bdf
- %% images a 1 bit/sample image given height,width and image data
- /im{ %% width height sw sh tx ty im -hexdata-
- translate
- scale
- /height edf
- /width edf
- /tbitstr width 7 add 8 div cvi string def
- width height 1 [width 0 0 height neg 0 height]
- {currentfile tbitstr readhexstring pop}bind
- i
- }bdf
- /imk{ %% width height sw sh tx ty flag imk
- /invFlag edf
- translate
- scale
- /height edf
- /width edf
- /tbitstr width 7 add 8 div cvi string def
- width height invFlag [width 0 0 height neg 0 height]
- {currentfile tbitstr readhexstring pop}bind
- imagemask
- }bdf
- /BeginEPSF
- {
- /MySave save def
- /dict_count countdictstack def
- /op_count count 1 sub def
- userdict begin
- /showpage {} def
- 0 setgray 0 setlinecap
- 1 setlinewidth 0 setlinejoin
- 10 setmiterlimit [] 0 setdash newpath
- /languagelevel where
- {pop languagelevel 1 ne{false setstrokeadjust false setoverprint}if}if
- }bdf
- /EndEPSF
- {
- count op_count sub {pop}repeat
- countdictstack dict_count sub {end}repeat
- MySave restore
- }bdf
- /setpat {1 currenttransfer exec 0 eq{exch pop{1 exch sub}}{pop{}}ifelse systemdict begin settransfer end /patstr edf 9.375 currot neg rotate 1 0 dtransform exch atan 0 1 dtransform exch pop 0 ge{180 add}if currot rotate/patspot load systemdict begin setscreen end}bdf
- systemdict/setcmykcolor known not{/setcmykcolor{/black edf 3{black add 1.0 exch sub 0.0 max 1.0 min 3 1 roll}repeat setrgbcolor}bdf}if
- /setpcol{/pgray edf systemdict/setcmykcolor known{/pgray 1 pgray sub def 4{0 eq{0}{pgray}ifelse 4 1 roll}repeat setcmykcolor}
- {setcmykcolor currentgray 1 ne{pgray}{1}ifelse setgray}ifelse}bdf
- /rectpath {/cv_r edf/cv_b edf/cv_l edf/cv_t edf
- cv_l cv_t moveto cv_r cv_t lineto cv_r cv_b lineto cv_l cv_b lineto cv_l cv_t lineto closepath}bdf
- /setpen {/penh edf/penv edf/penv2 penv 2 div def/penh2 penh 2 div def}bdf
- /dostroke{save /MySave edf not pens 1 currentgray ne or {s}if MySave restore}def
- /dodashfill{save /MySave edf not fills 1 currentgray ne or {gsave f grestore [] 0 setdash s}if MySave restore}def
- /dofill{save /MySave edf not fills 1 currentgray ne or {f}if MySave restore}def
- /doline{save /MySave edf not pens 1 currentgray ne or {f}if MySave restore}def
- /pmov{penv2 add exch penh2 sub exch moveto}bdf/plin{penv2 add exch penh2 sub exch lineto}bdf
- /linpath{/cv_b edf/cv_r edf/cv_t edf/cv_l edf penh2 dup cv_r exch sub/cv_r edf
- cv_l exch sub/cv_l edf penv2 dup cv_b add/cv_b edf cv_t add/cv_t edf cv_r cv_l gt
- {cv_b cv_t lt{cv_l cv_t moveto penh 0 rlineto cv_r penh add cv_b lineto 0 penv neg rlineto penh neg 0 rlineto
- cv_l cv_t penv neg add lineto}{cv_l cv_t moveto cv_r cv_b lineto penh 0 rlineto 0 penv neg rlineto
- cv_l penh add cv_t penv neg add lineto penh neg 0 rlineto 0 penv rlineto}ifelse}{cv_b cv_t lt{
- cv_l cv_t moveto cv_r cv_b lineto 0 penv neg rlineto penh 0 rlineto cv_l penh add cv_t penv neg add lineto 0 penv rlineto penh neg 0 rlineto}{
- cv_l penh add cv_t moveto cv_r penh add cv_b lineto penh neg 0 rlineto 0 penv neg rlineto
- cv_l cv_t penv neg add lineto penh 0 rlineto 0 penv rlineto}ifelse}ifelse closepath}bdf
- /dopline {/cv_pv edf/cv_ph edf currentpoint cv_ph cv_pv linpath doline newpath cv_ph cv_pv moveto}bdf
- /spx{SpaceExtra 0 32 4 -1 roll widthshow}bdf
- /lsx{SpaceExtra 0 32 LetterSpace 0 6 -1 roll awidthshow}bdf
- /Rjust{stringwidth pop JustOffset exch sub /JustOffset edf}bdf
- /Cjust{stringwidth pop 2 div JustOffset exch sub /JustOffset edf}bdf
- /adjfit{stringwidth pop LetterSpace StringLength 1 sub mul add SpaceExtra NumSpaces mul add dup /pw edf JustOffset exch
- sub dup /wdif edf StringLength div LetterSpace add /LetterSpace edf}bdf
- /ulb{currentpoint pop /underlinpt edf}bdf
- /ule{gsave currentpoint newpath moveto currentfont dup /ft1 known{dup /ft1 get begin /FontMatrix get FontMatrix tpmx concatmatrix pop}
- {begin FontMatrix tpmx copy pop}ifelse FontInfo begin UnderlinePosition UnderlineThickness end end dup tpmx
- dtransform pop setlinewidth dup tpmx dtransform pop 0 exch rmoveto underlinpt currentpoint pop sub 0 rlineto stroke grestore}bdf
- /fittext{ /SpaceExtra edf /LetterSpace edf /StringLength edf /NumSpaces edf /JustOffset edf not 1 currentgray ne or
- {dup {ulb}if exch
- dbg not {dup adjfit}if
- lsx {ule}if}{pop pop}ifelse}bdf
- %% debugging aid
- /Debug{ gsave /Times-Roman findfont 8 scalefont setfont
- gsave 0 -2 rmoveto ( adj= ) show wdif 32 string cvs show grestore
- gsave 0 6 rmoveto ( width= ) show pw 32 string cvs show grestore
- gsave 65 -2 rmoveto (lsp= ) show LetterSpace 32 string cvs show grestore
- gsave 65 6 rmoveto (spx= ) show SpaceExtra 32 string cvs show grestore
- grestore
- }bdf
- %%
- /cvRecFont{/encod edf FontDirectory 2 index known{cleartomark}{findfont dup length 1 add dict begin
- {1 index/FID ne{def}{pop pop}ifelse}forall encod{/Encoding CVvec def}if
- currentdict end definefont cleartomark}ifelse}bdf
- /wrk1 ( ) def/wdict 16 dict def
- /Work75 75 string def /Nmk{Work75 cvs dup}bdf /Npt{put cvn}bdf /dhOdh{Nmk 2 79 Npt}bdf /dhodh{Nmk 2 111 Npt}bdf /dhSdh{Nmk 2 83 Npt}bdf
- /sfWidth{gsave 0 0 moveto 0 0 lineto 0 0 lineto 0 0 lineto closepath clip stringwidth grestore}bdf
- /MakOF{dup dhodh FontDirectory 1 index known{exch pop}{exch findfont dup length 1 add dict begin
- {1 index/FID ne 2 index /UniqueID ne and{def}{pop pop}ifelse}forall
- /PaintType 2 def
- /StrokeWidth .24 1000 mul ftSize div dup 12 lt{pop 12}if def
- dup currentdict end definefont pop}ifelse}bdf
- /fts{dup/ftSize edf}def
- /mkFT{/tempFT 11 dict def tempFT begin
- /FontMatrix [1 0 0 1 0 0] def/FontType 3 def
- FontDirectory 3 index get /Encoding get/Encoding exch def
- /proc2 edf/ft2 exch findfont def/ft1 exch findfont def/FontBBox [0 0 1 1] def
- /BuildChar{wdict begin/chr edf/ftdt edf/chrst wrk1 dup 0 chr put def ftdt/proc2 get exec end}def
- end tempFT definefont pop}bdf
- /OLFt{dup dhOdh FontDirectory 1 index known{exch pop}
- {dup 3 -1 roll dup MakOF {outproc} mkFT}ifelse}bdf
- /mshw{moveto show}bdf
- /outproc{ftdt/ft1 get setfont gsave chrst sfWidth grestore setcharwidth dblsh}bdf
- /dblsh{currentgray 1 setgray chrst 0 0 mshw setgray ftdt/ft2 get setfont chrst 0 0 mshw}bdf
- /ShadChar{ftdt/ft1 get setfont gsave chrst sfWidth 1 index 0 ne{exch .05 add exch}if grestore setcharwidth
- chrst .06 0 mshw 0 .05 translate dblsh}bdf
- /ShFt{dup dhSdh FontDirectory 1 index known{exch pop}
- {dup 3 -1 roll dup MakOF {ShadChar} mkFT}ifelse}bdf
- /LswUnits{72 75 div dup scale}bdf
- /erasefill{gsave 1.0 setgray fill grestore}bdf
- /tpmx matrix def
- /CVvec 256 array def
- /NUL/SOH/STX/ETX/EOT/ENQ/ACK/BEL/BS/HT/LF/VT/FF/CR/SO/SI/DLE/DC1/DC2/DC3/DC4/NAK/SYN/ETB/CAN/EM/SUB/ESC/FS/GS/RS/US
- CVvec 0 32 getinterval astore pop
- CVvec 32/Times-Roman findfont/Encoding get
- 32 96 getinterval putinterval CVvec dup 39/quotesingle put 96/grave put
- /Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis/Udieresis/aacute
- /agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute/egrave
- /ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde/oacute
- /ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex/udieresis
- /dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
- /registered/copyright/trademark/acute/dieresis/notequal/AE/Oslash
- /infinity/plusminus/lessequal/greaterequal/yen/mu/partialdiff/summation
- /product/pi/integral/ordfeminine/ordmasculine/Omega/ae/oslash
- /questiondown/exclamdown/logicalnot/radical/florin/approxequal/Delta/guillemotleft
- /guillemotright/ellipsis/blank/Agrave/Atilde/Otilde/OE/oe
- /endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide/lozenge
- /ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright/fi/fl
- /daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand/Acircumflex/Ecircumflex/Aacute
- /Edieresis/Egrave/Iacute/Icircumflex/Idieresis/Igrave/Oacute/Ocircumflex
- /apple/Ograve/Uacute/Ucircumflex/Ugrave/dotlessi/circumflex/tilde
- /macron/breve/dotaccent/ring/cedilla/hungarumlaut/ogonek/caron
- CVvec 128 128 getinterval astore pop
-